<!DOCTYPE html>
<html  style="overflow : hidden; ">
<head>
    <title>前端底图绘制</title>
    <meta name="keywords" content="矢量瓦片,矢量索引">
    <meta name="description" content="矢量瓦片">
    <meta name="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,target-densitydpi=high-dpi,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="../sdk_web/LeafletSDK_es6/css/leaflet.css" />

</head>

<body onload="init()"  style="margin : 0; ">
<div id="map" class="map" style ="position:absolute;bottom:0px;top:0px;width:100%"></div>

<script src="../sdk_web/LeafletSDK_es6/dist/leaflet-src.js"></script>
<script src="../sdk_web/LeafletSDK_es6/dist/leaflet.js"></script>
<script src="../sdk_web/LeafletSDK_es6/dist/CustomWebSDK.min.js"></script> 
<script src="../libs/jquery-1.12.3.min.js"></script>
<script>
    function init(){
        //创建地图并配置参数
        var map = L.map('map',{crs:L.CRS.CustomEPSG4326,center: {lon:120.15, lat:30.268},maxZoom: 21,zoom:8,inertiaDeceleration:15000,inertiaThreshold:2000,fadeAnimation:false});

        //添加底图 前端绘制
        var layer = new L.GVMapGrid('http://ditu.zjzwfw.gov.cn/mapserver/data/zjvmap/getData?x={x}&y={y}&l={z}&styleId=tdt_biaozhunyangshi_2017',{tileSize:512,maxZoom: 21,keepBuffer:0,updateWhenZooming:false});

        map.addLayer(layer);

        //添加注记图层
        var labelLayer = new L.GWVTAnno({tileSize:512});
        var dataSource = new Custom.URLDataSource();
        dataSource.url = 'http://ditu.zjzwfw.gov.cn/mapserver/label/zjvmap/getDatas?x=${x}&y=${y}&l=${z}&styleId=tdt_biaozhunyangshi_2017';
        labelLayer.addDataSource(dataSource);
        map.addLayer(labelLayer);
    }
</script>

</body>
</html>